package de.islanders.shared;

public class ValueSpan<T extends Number> {
	
	private final T low;
	private final T high;
	
	public ValueSpan(T low) {
		this(low, null);
	}
	
	public ValueSpan(T low, T high) {
		this.low = low;
		this.high = high;
	}
	
	public boolean isSpan() {
		return high != null;
	}
	
	public T getLow() {
		return low;
	}
	
	public T getHigh() {
		return (high != null ? high : low);
	}
	
	@Override
	public String toString() {
		return low + "-" + high;
	}
}
